﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>在线投票 - {config.webname}</title>
<link type="text/css" rel="stylesheet" href="{config.webpath}css/validate.css" />
<link type="text/css" rel="stylesheet" href="{config.webpath}scripts/artdialog/ui-dialog.css" />
<link href="<%templateskin="statistics"%>/css/yxtj.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{config.webpath}scripts/jquery/jquery-1.11.2.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="<%templateskin="statistics"%>/js/common.js"></script>
    <script type="text/javascript">
        var jq=jQuery.noConflict();
    </script>
    <script type="text/javascript" src="{config.webpath}plugins/questionnaire/js/chao.js"></script>
<script type="text/javascript" src="{config.webpath}scripts/jquery/jquery.form.min.js"></script>
<script type="text/javascript" src="{config.webpath}scripts/jquery/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="{config.webpath}scripts/artdialog/dialog-plus-min.js"></script>
<script type="text/javascript" src="{config.webpath}plugins/questionnaire/js/common.js"></script>

<script type="text/javascript">
    //切换验证码
function ToggleCode(obj, codeurl) {
    jq(obj).children("img").eq(0).attr("src", codeurl + "?time=" + Math.random());
	return false;
}
    jq(function () {
       
        //初始化表单
        AjaxInitFormjq('#form1', '#btnSubmit', 1, '#turlvote');
    });
</script>
</head>

<body>
<!--头部模版-->
<%template skin="statistics" src="header.html"%>
    <div class="bodybj" style="width:1002px;margin:0 auto;">
        <!--左边开始 -->
            <div class="left">
                <div class="chnl_tit">在线调查</div>
                <div class="chnl_tit2_bg"></div>
                <div id="left_height_js" class="chnl_list_blk">
                    <ul class="chnl_list">
                        <li class="onChnl" rel="Chnl"><a href="<%linkurl("vote_list")%>">在线调查</a></li>
                    </ul>
                    <div class="clear"></div>
                </div>
            </div>
            <!--左边结束 -->
<div id="main" style="background:white;margin-top:-5px;padding-top:10px;font-size:16px;color:#1E50A0;width: 740px;float: left;margin-left: 11px;">
    <div style="height:17px;float:left;overflow:hidden;margin:10px;"><img src="<%templateskin="statistics"%>/images/vote_bg.gif" /style="height:150px;width:16px;"></div>
<div style="height:42px;"><h1 style="padding-top:9px;">{model.title}</h1></div>
<hr />
<div style="margin-left:25px;">
<p>投票内容：{model.title}  </p>


<form id="form1" name="form1" url="{config.webpath}plugins/questionnaire/ajax.ashx?action=add&vote_id={model.id}">
    <div>
    <div style="height:17px;float:left;overflow:hidden;margin:10px;"><img src="<%templateskin="statistics"%>/images/vote_bg.gif" /style="height:150px;width:16px;"></div>
<div style="height:40px;"><h1 style="font-size:16px;color:#1E50A0;margin-left:10px;padding-top:8px;">调查主题</h1></div>
<hr /style="width:650px;float:left;">
  <ul class="news2" style="width:650px;float:left;">
    <%set DataTable voteList=get_list(100, page, "1=1", out totalcount)%>
    <%set string pagelist=get_page_link(100, page, totalcount, "vote_list", "__id__")%>
    <%foreach(DataRow dr in voteList.Rows)%>
    <li style="margin-top:15px;margin-left:20px;">{dr[title]} <a id="n2">{dr[add_time]}</a></li>
      <%set EazyCMS.Web.Plugin.Naire.Model.vote voteList2=get_list({strtoint({dr[id]})})%>
      <!--投票选项-->
      <%if(voteList2.options!=null)%>
      <%foreach(EazyCMS.Web.Plugin.Naire.Model.vote_option modelt in voteList2.options)%>
      <dl>
          <dt style="display:inline">
              <%if(voteList2.is_multi==1)%>
              <input type="checkbox" name="option_id" value="{modelt.id}" />
              <%else%>
              <input type="radio" name="option_id{modelt.vote_id}"  value="{modelt.id}" />
              <%/if%>
          </dt>
          <dd style="display:inline">
              <%csharp%>
              string percent="0";
              if(voteList2.vote_count>0){
              percent=(double.Parse(modelt.vote_num.ToString())/double.Parse(model2.vote_count.ToString())*100).ToString("0");
              }
              <%/csharp%>
              {modelt.title} 
          </dd>
      </dl>
      <%/foreach%>
      <%/if%>
      <!--/投票选项-->

    <%/foreach%>
  </ul>
    
</div>

<!--放置页码-->
<div class="flickr">{pagelist}</div>
  <div class="form_box">
      <dl>
          <!--<dt style="width:338px;float:left;">意见建议：</dt>
          <dd style="width:1002px;float:left;"><textarea id="remarkc" name="remarkc" class="input txt" datatype="*" sucmsg=" " style="width:350px;height:20px;"></textarea></dd>-->
      </dl>
    <dl>
      <dt style="width:338px;float:left;">手机号码：</dt>
      <dd style="width:1002px;float:left;"><textarea id="remark" name="remark" class="input txt" datatype="*" sucmsg=" " style="width:350px;height:24px;"></textarea></dd>
    </dl>
    <dl style="float:left;">
      <dt>验证码：</dt>
      <dd>
        <input id="code" name="code" type="text" class="input small" datatype="*" sucmsg=" " />
        <a href="javascript:;" onclick="ToggleCode(this, '{config.webpath}tools/verify_code.ashx');return false;"><img src="{config.webpath}tools/verify_code.ashx" width="80" height="22" align="absmiddle" /> 看不清楚？</a>
        <span class="Validform_checktip"></span>
      </dd>
    </dl>
    <dl style="float:left;width:1002px;">
      <dt></dt>
      <dd>
        <input id="btnSubmit" name="btnSubmit" type="submit" value="确认" class="btn_submit" />
        <input id="turlvote" type="hidden" value="<%linkurl("vote_post",{model.id})%>" /><!--存储提交成功后跳转的URL-->
      </dd>
    </dl>

  </div>
</form>
</div>
</div>
        <div class="clear"></div>
    <!--Footer-->
    <%template skin="statistics" src="footer.html"%>
    <!--/Footer-->
        </div>
</body>
</html>
